home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gxcolor2.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  3.8 KB  |  93 lines

  1. /* Copyright (C) 1993, 2000 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gxcolor2.h,v 1.4 2000/09/19 19:00:35 lpd Exp $ */
  20. /* Internal definitions for Level 2 color routines */
  21. /* Requires gsstruct.h, gxfixed.h */
  22.  
  23. #ifndef gxcolor2_INCLUDED
  24. #  define gxcolor2_INCLUDED
  25.  
  26. #include "gscolor2.h"
  27. #include "gsmatrix.h"        /* for step_matrix */
  28. #include "gsrefct.h"
  29. #include "gxbitmap.h"
  30.  
  31. /* Cache for Indexed color with procedure, or Separation color. */
  32. struct gs_indexed_map_s {
  33.     rc_header rc;
  34.     union {
  35.     int (*lookup_index)(P3(const gs_indexed_params *, int, float *));
  36.     int (*tint_transform)(P3(const gs_separation_params *, floatp, float *));
  37.     } proc;
  38.     void *proc_data;
  39.     uint num_values;    /* base_space->type->num_components * (hival + 1) */
  40.     float *values;    /* actually [num_values] */
  41. };
  42. #define private_st_indexed_map() /* in gscolor2.c */\
  43.   gs_private_st_ptrs2(st_indexed_map, gs_indexed_map, "gs_indexed_map",\
  44.     indexed_map_enum_ptrs, indexed_map_reloc_ptrs, proc_data, values)
  45.  
  46. /* Define a lookup_index procedure that just returns the map values. */
  47. int lookup_indexed_map(P3(const gs_indexed_params *, int, float *));
  48.  
  49. /* Allocate an indexed map and its values. */
  50. /* The initial reference count is 1. */
  51. int alloc_indexed_map(P4(gs_indexed_map ** ppmap, int num_values,
  52.              gs_memory_t * mem, client_name_t cname));
  53.  
  54. /* Free an indexed map and its values when the reference count goes to 0. */
  55. rc_free_proc(free_indexed_map);
  56.  
  57. /**************** TO gxptype1.h ****************/
  58.  
  59. /*
  60.  * We define 'tiling space' as the space in which (0,0) is the origin of
  61.  * the key pattern cell and in which coordinate (i,j) is displaced by
  62.  * i * XStep + j * YStep from the origin.  In this space, it is easy to
  63.  * compute a (rectangular) set of tile copies that cover a (rectangular)
  64.  * region to be tiled.  Note that since all we care about is that the
  65.  * stepping matrix (the transformation from tiling space to device space)
  66.  * yield the right set of coordinates for integral X and Y values, we can
  67.  * adjust it to make the tiling computation easier; in particular, we can
  68.  * arrange it so that all 4 transformation factors are non-negative.
  69.  */
  70.  
  71. typedef struct gs_pattern1_instance_s {
  72.     gs_pattern_instance_common;    /* must be first */
  73.     gs_pattern1_template_t template;
  74.     /* Following are created by makepattern */
  75.     gs_matrix step_matrix;    /* tiling space -> device space */
  76.     gs_rect bbox;        /* bbox of tile in tiling space */
  77.     bool is_simple;        /* true if xstep/ystep = tile size */
  78.     /*
  79.      * uses_mask is always true for PostScript patterns, but is false
  80.      * for bitmap patterns that don't have explicit transparent pixels.
  81.      */
  82.     bool uses_mask;            /* if true, pattern mask must be created */
  83.     gs_int_point size;        /* in device coordinates */
  84.     gx_bitmap_id id;        /* key for cached bitmap (= id of mask) */
  85. } gs_pattern1_instance_t;
  86.  
  87. #define private_st_pattern1_instance() /* in gsptype1.c */\
  88.   gs_private_st_composite(st_pattern1_instance, gs_pattern1_instance_t,\
  89.     "gs_pattern1_instance_t", pattern1_instance_enum_ptrs,\
  90.     pattern1_instance_reloc_ptrs)
  91.  
  92. #endif /* gxcolor2_INCLUDED */
  93.